/**
 * 
 */
package edu.unipd.p2t.connection;

import java.io.IOException;

import edu.unipd.p2t.communicaton.p2tDevice;


/**
 * @author Tommaso Dal Sasso
 *
 */
public interface Device extends p2tDevice {

	public static final String TAG = "DEVICE";

	/**
	 * @param thing
	 */
	public abstract void send( Object thing ) throws IOException;

	
	/**
	 * @return
	 */
	public abstract Object receive() throws IOException;

	
	/**
	 * Attempts to connect with a device with peer2tweet (must have the same UUID)
	 * @return true if the connection succeeds and we are awaiting to start communication, false otherwise
	 */
	public abstract boolean connect();


	void setFirst( boolean isFirst );

}
